import loading from '@/components/loading.vue';
import { h, render } from 'vue'
export default {
    install(app) {
        app.directive("load", load())
    }
}
const load = () => {
    let vNode = h(loading)
    return {
        updated(el, { value }) {
            if (value) {
                render(vNode, el);
                el.append(vNode.el)
            } else {
                if (el.contains(vNode.el)) {
                    el.removeChild(vNode.el);

                }

            }
        }
    }
}